package com.kiven.annotations;

import java.lang.reflect.Method;
import java.util.*;

public class UseCaseTracker {
	public static void trackUseCases(List<Integer> useCases,Class<?> clazz) {
		for (Method m : clazz.getDeclaredMethods()) {
			UserCase uc = m.getAnnotation(UserCase.class);
			if (uc != null) {
				System.out.println("Found Use Case :" + uc.id() + " "
						+ uc.description());
				useCases.remove(new Integer(uc.id()));
			}
		}
		
		for (int i : useCases) {
			System.out.println("Warning : Missing Use Case-" + i);
		}
	}

	public static void main(String[] args) {
		List<Integer> useCases = new ArrayList<Integer>();
		Collections.addAll(useCases, 47,48,49,50);
		trackUseCases(useCases,PasswordUtils.class);
	}

}
